package com.ssextjs.component;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.ssextjs.engine.ConfiguraionImpl;

public class Toolbar extends Component{
	public List<Object> items = new ArrayList();
	public boolean noHeaders = false;
	//private int idc=1;
	public Toolbar(Map opt) {
		//Default values
		super();
		mainopt.putAll(opt);
		tplInit();
	}
	
	public Toolbar() {
		tplInit();
	}
	
	public void tplInit() {
		try {
			tpl = ConfiguraionImpl.getCfg().getTemplate("Toolbar.tpl");
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public Toolbar addItem(Object item) {
		items.add(item);
		return this;
	}
	
	public Toolbar noHeader(boolean fl) {
		this.noHeaders=fl;
		return this;
	}
}
